package org.xlp.db.xml;

import org.xlp.utils.XLPStringUtil;

import java.util.ArrayList;
import java.util.List;

/**
 * sql配置文件信息
 */
public class SQLConfigurationFileInfo {
    /**
     * 当前解析的文件描述
     */
    private String fileDescription;

    /**
     * Sql配置信息集合
     */
    private List<SQLsElementInfo> sqlsElementInfos = new ArrayList<>();

    /**
     * 其余Sql配置文件路径
     */
    private List<String> sqlConfigurationFilePaths = new ArrayList<>();

    public String getFileDescription() {
        return fileDescription;
    }

    public void setFileDescription(String fileDescription) {
        this.fileDescription = fileDescription;
    }

    public List<SQLsElementInfo> getSqlsElementInfos() {
        return sqlsElementInfos;
    }

    public void setSqlsElementInfos(List<SQLsElementInfo> sqlsElementInfos) {
        if (sqlsElementInfos != null) {
            this.sqlsElementInfos = sqlsElementInfos;
        }
    }

    public List<String> getSqlConfigurationFilePaths() {
        return sqlConfigurationFilePaths;
    }

    public void setSqlConfigurationFilePaths(List<String> sqlConfigurationFilePaths) {
        if (sqlConfigurationFilePaths != null) {
            this.sqlConfigurationFilePaths = sqlConfigurationFilePaths;
        }
    }

    /**
     * 添加SqlsEle对象
     * @param sqlsElementInfo
     */
    public void addSqLsElementInfo(SQLsElementInfo sqlsElementInfo){
        if (sqlsElementInfos != null){
            sqlsElementInfos.add(sqlsElementInfo);
        }
    }

    /**
     * 添加其余Sql配置文件信息
     * @param sqlConfigurationFilePath
     */
    public void addSqlConfigurationFilePath(String sqlConfigurationFilePath){
        if (!XLPStringUtil.isEmpty(sqlConfigurationFilePath)){
            sqlConfigurationFilePaths.add(sqlConfigurationFilePath);
        }
    }
}
